.section .init
.globl _start
_start:
	mov sp, #0x8000
	mov r0, #16
	mov r1, #1
	bl SetGPIOFunction
	ldr r0, =1400
	ldr r1, =1050
	mov r2, #32
	bl InitialiseFrameBuffer
	teq r0, #0
	bne no_error
	mov r0, #0
	bl OKLedBlink
error:
	b error
no_error:
	fbsAdd .req r0
	fbAdd .req r1
	color .req r2
	row .req r3
	col .req r4
render:
	ldr fbAdd, [fbsAdd, #32]
	mov color, #0xFF
	ldr row, =1050
	draw_row:
		sub row, #1
		cmp row, #0
		blt render
		ldr col, =1400
		ldr r5, =15534
		add color, r5
		draw_pixel:
			sub col, #1
			cmp col, #0
			blt draw_row
			str color, [fbAdd]
			add fbAdd, #2
			b draw_pixel
